<template>
    <div class="my-children">
        <div class="title">
            <H2>{{name}}类视频</H2>
        </div>
        <index-item v-for="(item,index) in list" :key="index" :title="item.typeName" :type-id="id" :type2-id="item.id" ></index-item>
    </div>
</template>

<script>
import indexItem from "../components/index-item.vue";
export default {
    name: 'my-children',
    data: function() {	
        return {
            id:0,
            list:[],
            name:""
        }
    },
    methods: {
        getType2List(){
            this.axios.post('videoType/getType2List',{
                id:this.id,
                pageSize:1000
            }).then(res=>{
                this.list= res.data.page.list
                this.name = this.list[0].type1Name
            })
        },
    },
    created(){
       this.id = this.$route.query.id
       this.getType2List();
    },
    components:{
        indexItem
    },
    watch:{
        $route:function(){
            this.id=this.$route.query.id
            this.getType2List();
        }
    }
}
</script>

<style lang="scss" scoped>
    .title{
        color: #303133;
        border-bottom: 2px dashed #DCDFE6;
    }
</style>